<!--
  @author yangjiangming
  @date 2018/11/26 10:00
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head>
    <title>工单列表数据表格数据列模板</title>
</head>

<body>
    <table>
        <thead>
            <tr>

                <th:block th:fragment="index(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'index', title: '序号', align: 'center', templet: '#index' }">
                        序号
                        <script type="text/html" id="index">
                            {{d.LAY_TABLE_INDEX+1}}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="orderId(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'orderId', title: '工单号' }">工单号</th></th:block>

                <th:block th:fragment="earlyWarning(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'earlyWarning', title: '预警', align: 'center' }">预警</th></th:block>

                <th:block th:fragment="provinceCityName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}" lay-data="{ field: 'provinceCityName', title: '省市',width: 110, templet: '<span>{{d.provinceName}} {{d.cityName}}</span>>', sort: true }">省市</th></th:block>

                <th:block th:fragment="faultContent(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'faultContent', title: '故障信息' }">故障信息</th></th:block>

                <th:block th:fragment="channelName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'channelName', title: '下单渠道', sort: true }">下单渠道</th></th:block>

                <th:block th:fragment="reviewStatusName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'reviewStatusName', title: '审核状态' }">审核状态</th></th:block>

                <th:block th:fragment="equtityTypeName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'equtityTypeName', title: '会员权益' }">会员权益</th></th:block>

                <th:block th:fragment="isMember(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'isMember', title: '延保订单', align: 'center', templet: (d) => `${d.isMember ? '是' : '-' }` }">延保订单</th></th:block>

                <th:block th:fragment="receiveTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'receiveTime', title: '下单时间', width: 100, align: 'center', sort: true }">下单时间</th></th:block>

                <th:block th:fragment="checkoutTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'checkoutTime', title: '收单时间' }">收单时间</th></th:block>

                <th:block th:fragment="accountTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'accountTime', title: '算账时间' }">算账时间</th></th:block>

                <th:block th:fragment="dutyTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'dutyTime', title: '预约时间', width: 100, align: 'center', sort: true }">预约时间</th></th:block>

                <th:block th:fragment="commentTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'commentTime', title: '评价时间', width: 150, align: 'center', sort: true }">评价时间</th></th:block>

                <th:block th:fragment="replyVisitTime(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'replyVisitTime', title: '回访时间', width: 100, align: 'center', sort: true }">回访时间</th></th:block>

                <!--                <th:block th:fragment="cityName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'cityName', title: '城市', align: 'center', sort: true }">城市</th></th:block>-->

                <th:block th:fragment="typeName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'typeName', title: '评价方式', align: 'center' }">评价方式</th></th:block>

                <th:block th:fragment="commentContent(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'commentContent', title: '评价内容' }">评价内容</th></th:block>

                <th:block th:fragment="purposeProductInfo(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'purposeProductInfo', title: '服务信息',align: 'center', templet: (d) => d.productInfo }">服务信息</th></th:block>

                <th:block th:fragment="servCategName(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'servCategName', title: '服务分类', align: 'center' }">服务分类</th></th:block>

                <th:block th:fragment="creator(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'creater', title: '录入人', align: 'center' }">录入人</th></th:block>

                <th:block th:fragment="deptCreator(premitId)"><th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'creater', title: '录入人', align: 'center', templet: (d) => `${d.deptName ? d.deptName + '-' : '' }${d.creater || ''}` }">录入人</th></th:block>

                <th:block th:fragment="operate(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'operate', title: '操作', align: 'center', width: 65, fixed: 'right', toolbar: '#btn-operator' }">
                        操作
                        <script type="text/html" id="btn-operator">
                            <a class="layui-btn layui-btn-sm btn-operate"
                               data-tooltip-content="#tooltip_content"
                               data-work-id="{{d.workId}}"
                               data-order-id="{{d.orderId}}"
                               lay-event="operate">操作</a>
                        </script>
                    </th>
                </th:block>

                <!-- 意向单操作 -->
                <th:block th:fragment="operateForPurposeList(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'operate', title: '操作', align: 'center', width: 65, fixed: 'right', toolbar: '#btn-operator' }">
                        操作
                        <script type="text/html" id="btn-operator">
                            <a class="layui-btn layui-btn-sm btn-operate"
                               data-tooltip-content="#tooltip_content"
                               data-order-purpose-id="{{d.orderPurposeId}}"
                               lay-event="operate">操作</a>
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="warningVO(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'warningVO', title: '警示', align: 'center', width: 86, templet: '#warningTpl' }">
                        警示
                        <script type="text/html" id="warningTpl">
                            {{ templateUtils.formatWarning()(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="currentRemark(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'currentRemark', title: '工单备注', templet: '#remarkTpl' }">
                        工单备注
                        <script type="text/html" id="remarkTpl">
                            {{ templateUtils.formatRemark(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="currentTrackInfo(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'trackInfo', title: '跟单信息', templet: '#trackInfoTpl' }">
                        跟单信息
                        <script type="text/html" id="trackInfoTpl">
                            {{ templateUtils.formatTrackInfo(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="username(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}" lay-data="{ field: 'username', title: '用户信息', minWidth: 120,templet: '#userInfoTpl' }">
                        用户信息
                        <script type="text/html" id="userInfoTpl">
                            {{ templateUtils.formatUserInfo(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="userPhone(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'userPhone', title: '用户信息', templet: '#userInfoAllTpl' }">
                        用户信息
                        <script type="text/html" id="userInfoAllTpl">
                            {{ templateUtils.formatUserInfoAll(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="countyName(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'countyName', title: '地址', minWidth: 225, sort: true, templet: '#addressTpl' }">
                        地址
                        <script type="text/html" id="addressTpl">
                            {{ templateUtils.formatFullAddress(d) }}
                        </script>
                    </th>
                </th:block>


                <th:block th:fragment="productInfo(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'productInfo', title: '服务信息', minWidth: 225, sort: true, templet: '#productInfoTpl' }">
                        服务信息
                        <script type="text/html" id="productInfoTpl">
                            {{ templateUtils.formatProductInfo(d) }}
                        </script>
                    </th>
                </th:block>
                <th:block th:fragment="masterName(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'masterName', title: '工程师', sort: true, templet: '#masterInfoTpl' }">
                        工程师
                        <script type="text/html" id="masterInfoTpl">
                            {{ templateUtils.formatMasterInfo(d) }}
                        </script>
                    </th>
                </th:block>
                <th:block th:fragment="status(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'status', title: '状态', align: 'center', sort: true, templet: '#statusTpl' }">
                        状态
                        <script type="text/html" id="statusTpl">
                            {{ templateUtils.resultStatusFormatterFactory('status')(d) }}
                        </script>
                    </th>
                </th:block>
                <th:block th:fragment="result(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'resultStatus', title: '结果', align: 'center', sort: true, templet: '#resultTpl' }">
                        结果
                        <script type="text/html" id="resultTpl">
                            {{ templateUtils.resultStatusFormatterFactory('result')(d) }}
                        </script>
                    </th>
                </th:block>
                <th:block th:fragment="payStatusName(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'payStatusName', title: '支付状态', align: 'center', sort: true, templet: '#payStatusNameTpl' }">
                        支付状态
                        <script type="text/html" id="payStatusNameTpl">
                            {{ templateUtils.formatPayStatusName(d) }}
                        </script>
                    </th>
                </th:block>
                <th:block th:fragment="isReply(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'isReply', title: '回访', align: 'center', width: 65, templet: '#replayStateTpl' }">
                        回访
                        <script type="text/html" id="replayStateTpl">
                            {{ templateUtils.formatReplayState(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="cityName(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'cityName', title: '城市', sort: true, templet: '#cityInfoTpl' }">
                        城市
                        <script type="text/html" id="cityInfoTpl">
                            {{ templateUtils.formatCityInfo(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="originalAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'originalAmount', title: '订单金额', templet: '#originalAmountTpl' }">
                        订单金额
                        <script type="text/html" id="originalAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('originalAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="discountAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'discountAmount', title: '优惠', templet: '#discountAmountTpl' }">
                        优惠
                        <script type="text/html" id="discountAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('discountAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="totalAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'totalAmount', title: '订单收入', templet: '#totalAmountTpl' }">
                        订单收入
                        <script type="text/html" id="totalAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('totalAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="invoiceAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'invoiceAmount', title: '发票金额', templet: '#invoiceAmountTpl' }">
                        发票金额
                        <script type="text/html" id="invoiceAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('invoiceAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="partAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'partAmount', title: '配件销售总额', templet: '#partAmountTpl' }">
                        配件销售总额
                        <script type="text/html" id="partAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('partAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="subsidyAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'subsidyAmount', title: '绩效基数补贴', templet: '#subsidyAmountTpl' }">
                        绩效基数补贴
                        <script type="text/html" id="subsidyAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('subsidyAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="billAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'billAmount', title: '工程师绩效基数', templet: '#billAmountTpl' }">
                        工程师绩效基数
                        <script type="text/html" id="billAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('billAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="masterRewardsAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'masterRewardsAmount', title: '提成总额', templet: '#masterRewardsAmountTpl' }">
                        提成总额
                        <script type="text/html" id="masterRewardsAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('masterRewardsAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="settleAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'settleAmount', title: '到账结算', templet: '#settleAmountTpl' }">
                        到账结算
                        <script type="text/html" id="settleAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('settleAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="channelAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'channelAmount', title: '渠道佣金', templet: '#channelAmountTpl' }">
                        渠道佣金
                        <script type="text/html" id="channelAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('channelAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="partReimburseAmount(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'partReimburseAmount', title: '配件报销', templet: '#partReimburseAmountTpl' }">
                        配件报销
                        <script type="text/html" id="partReimburseAmountTpl">
                            {{ templateUtils.formatMoneyToYuan('partReimburseAmount')(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="commentScore(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'commentScore', title: '评星', align: 'center', width: 65, templet: '#commentScoreTpl' }">
                        评星
                        <script type="text/html" id="commentScoreTpl">
                            {{ templateUtils.formatCommentScore(d) }}
                        </script>
                    </th>
                </th:block>

                <th:block th:fragment="saleStatus(premitId)">
                    <th th:if="${#strings.isEmpty(premitId) ? true : #authPermit.checkPermit(premitId)}"  lay-data="{ field: 'saleStatus', title: '是否售卖', align: 'center', templet: '#orderPurposeSaleStatusTpl' }">
                        是否售卖
                        <script type="text/html" id="orderPurposeSaleStatusTpl">
                            {{ templateUtils.formatOrderPurposeSaleStatus(d) }}
                        </script>
                    </th>
                </th:block>
            </tr>
        </thead>
    </table>
</body>
</html>